package com.cslg.yougou.front.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.cslg.yougou.front.entity.GoodsType;
import com.cslg.yougou.front.mapper.GoodsTypeMapper;
import com.cslg.yougou.front.pojo.Result;
import com.cslg.yougou.front.service.GoodsTypeService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;
import org.springframework.util.StringUtils;

import java.util.List;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author zyw
 * @since 2020-11-06
 */
@Service
public class GoodsTypeServiceImpl extends ServiceImpl<GoodsTypeMapper, GoodsType> implements GoodsTypeService {

    @Override
    public Result getFirstgoodsType(String token, String current_time) {
        if(StringUtils.isEmpty(token)||StringUtils.isEmpty(current_time)){
            return Result.ok("token and current_time is empty");
        }
        QueryWrapper<GoodsType> goodsTypeQueryWrapper = new QueryWrapper<>();
        List<GoodsType> goodsTypes = this.baseMapper.selectList(goodsTypeQueryWrapper);
        return Result.ok(goodsTypes);
    }
}
